package com.pro.springbootpro.event;

import org.springframework.context.event.EventListener;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@Component
public class MyEventListener {

    @EventListener
    @Order(2)
    public void sendMail(MyEvent sourceEvent){
        sourceEvent.printMsg("发送邮件-----");
    }
    @Order(1)
    @EventListener
    public void sendSmg(MyEvent sourceEvent){
        sourceEvent.printMsg2("发送短信-----");
    }
}